//Galaxy Class - holds all information for galaxy:
// 2D Array of Quadrants
#pragma once
#include <iostream>
using namespace std ;

#include "Quadrant.h"
#include "Player.h"


class Galaxy
{
private:
	Quadrant *m_Quad[8][8] ;
	Player *m_player ;

public:
	Galaxy( ) ;
	~Galaxy( ) ;

	//get the player's data for when the other classes need it
	Player* GetPlayer( ) { return m_player ; }

	//Update the Player data
	void UpdatePlayer( int x, int y ) ;

	//Prepare the blasters, first taking energy away from the ship
	void SetBlasters( int energy ) ;

	//moves the player to another quadrant
	void WarpPlayer( int x, int y ) ;

	//scan the adjacent quadrants and set them to explored
	void ScanGalaxy( ) ;

	//Adjust player's shields
	void PlayerShields( int amount ) { m_player->ChangeShields( amount ) ; }

	//Tells the current quadrant to move the enemies
	void EnemyTurn( ) ;

	//checks if the player has made it to its target destination
	bool HasMoved( ) { return (m_player->GetTargetX( ) == m_player->GetPosX( ) && m_player->GetTargetY( ) == m_player->GetPosY( )) ; }

	bool PlayerIsDead( ) {return m_player->IsDead( ) ;}

	bool GetQuadExplored( ) {return m_Quad[m_player->GetQuadX()][m_player->GetQuadY()]->getExplored() ;}

	int GetQuadData( int x, int y ) {return m_Quad[m_player->GetQuadX()][m_player->GetQuadY()]->GetSector( x, y ) ;}

	int GetPlayerEnergy( ) {return m_player->GetEnergy() ;}

	int GetPlayerShields( ) {return m_player->GetShields() ;}

	int GetPlayerMissiles( ) {return m_player->GetMissileCount() ;}

	int FindPlayerPosX( ) {return m_player->GetPosX( ) ;}

	int FindPlayerPosY( ) {return m_player->GetPosY( ) ;}

	int FindPlayerQPosX( ) {return m_player->GetQuadX( ) ;}

	int FindPlayerQPosY( ) {return m_player->GetQuadY( ) ;}
};